<!DOCTYPE html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">

    <title>河大外卖管理系统</title>
    <meta name="keywords" content="H+后台主题,后台bootstrap框架,会员中心主题,后台HTML,响应式后台">
    <meta name="description" content="H+是一个完全响应式，基于Bootstrap3最新版本开发的扁平化主题，她采用了主流的左右两栏式布局，使用了Html5+CSS3等现代技术">
    <link href="css/bootstrap.min.css" rel="stylesheet">
    <link href="css/animate.css" rel="stylesheet">
    <link href="css/style.css" rel="stylesheet">
    <link href="css/login.css" rel="stylesheet">
    <!--[if lt IE 9]>
    <meta http-equiv="refresh" content="0;ie.html" />
    <![endif]-->
    <script>
        if (window.top !== window.self) {
            window.top.location = window.location;
        }
    </script>
    <style>
        .color{
            color: black;
        }
    </style>
</head>

<body class="signin">
<div class="signinpanel">
    <div class="row">
        <div class="col-sm-7">
            <div class="signin-info">
                <div class="logopanel m-b">
                    <h1><font style="color: black">[ 河大外卖 ]</font></h1>
                </div>
                <div class="m-b"></div>
                <font style="color:black;"> <h4>欢迎使用 <strong>河大外卖后台管理系统</strong></h4></font>
                <strong>还没有账号？ <a href="#">立即注册&raquo;</a></strong>
            </div>
        </div>
        <div class="col-sm-5">
            <form  id="form">
                <h4 class="no-margins color">登录：</h4>
                <p class="m-t-md color">登录到河大外卖后台管理系统</p>
                <input type="text" id="managerName" name="managerName" class="form-control uname" placeholder="用户名" />
                <input type="password" id="managerPassword" name="managerPassword" class="form-control pword m-b" placeholder="密码" />
                <a class="btn btn-success btn-block" onclick="login()" href="javascript:void(0)">登录</a>
            </form>
        </div>
    </div>
    <div class="signup-footer">
        <div class="pull-left">
            <font style="color: black" >&copy; 2018 All Rights Reserved. 河大外卖</font>
        </div>
    </div>
</div>
<script src="libs/jquery.min.js"></script>
<script src="libs/jquery.serializejson.min.js"></script>
<script type="text/javascript">
    function login() {
        var manager=$("#form").serializeJSON();
      $.ajax({
          url:"/admin/login.action",
          data:JSON.stringify(manager),
          type:"post",
          dataType:"json",
          contentType:"application/json",
          success:function (r) {
//              var data=JSON.parse(r);
               if (r.code==1){
//                   这里表示在数据库中验证成功；
                   window.location.href="/index/index.action";
               }else {
                   alert("登录失败"+r.code)
               }
          }
      })
    }
</script>
</body>

</html>
